const joi = require('joi')

// 当前页
const currentPage = joi.number().integer().min(1)

// 分页大小
const pageSize = joi.number().integer().min(1)

// 专栏id
const id = joi.number().integer().min(1).required()

// 专栏标题
const title = joi.string().max(1).max(50).required()

// 描述
const description = joi.string().required()

// 封面
const cover = joi.string().dataUri()

exports.list_column__schema = {
    query: {
        currentPage,
        pageSize
    }
}

exports.detail_column__schema = {
    params: {
        id
    }
}

exports.user_column__schema = {
    params: {
        userId: id
    }
}

exports.update_column_schema = {
    body: {
        id,
        title,
        description,
        cover
    }
}

exports.add_column_schema = {
    body: {
        title,
        description,
        cover,
        userId: id
    }
}